#pragma once
#include "tray_msg_item_base.h"

struct tray_msg_item 
{
	tray_msg_item(int _dlg_type, int _msg_type, CString _msg_key)
	{
		dlg_type = _dlg_type;
		msg_type = _msg_type;
		msg_key = _msg_key;
	}
	int dlg_type;
	int msg_type;
	CString msg_key;
};

typedef std::vector<tray_msg_item*> vec_tray_im_msg_item;

class tray_msg_item_im :
	public tray_msg_item_base
{
public:
	tray_msg_item_im(void);
	~tray_msg_item_im(void);
	typedef xy::thread_mutex mutex_type;
public:
	virtual void destroy();
	virtual BOOL execute_msg(LPCTSTR userid);

	virtual void push_msg(int im_dlg_type, int im_msg_type, LPCTSTR msgkey);
	virtual void push_msg(void* msg_data);
	virtual void merge(tray_msg_item_base *p);
	virtual void* get_item_data();
	virtual int get_msg_count();

	virtual void display(HWND hwnd, int row);
protected:
	virtual void _get_info();
	virtual void _get_nickname();
	CString _get_list_text();
public:
	
	vec_tray_im_msg_item* im_msgs_;
	CString name_;
	CString listtext_;
};
